package co.com.smart.persistence.entity.dto;

import java.io.Serializable;

import javax.persistence.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the smart_sedes database table.
 * 
 */
@Entity
@Table(name="smart_sedes")
@NamedQuery(name="SmartSede.findAll", query="SELECT s FROM SmartSede s")
public class SmartSede implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="sm_scsedes")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private BigDecimal smScsedes;

	@Column(name="sm_cosedes")
	private String smCosedes;

	@Column(name="sm_cousuario")
	private String smCousuario;

	@Column(name="sm_dssedes")
	private String smDssedes;

	@Temporal(TemporalType.DATE)
	@Column(name="sm_fhingreso")
	private Date smFhingreso;

	@Temporal(TemporalType.DATE)
	@Column(name="sm_fhmodificacion")
	private Date smFhmodificacion;

	@Temporal(TemporalType.DATE)
	@Column(name="sm_fhretiro")
	private Date smFhretiro;

	//bi-directional many-to-one association to SmartAgenda
	@OneToMany(cascade = CascadeType.ALL,mappedBy="smartSede", fetch = FetchType.LAZY)
	private List<SmartAgenda> smartAgendas;

	//bi-directional many-to-one association to SmartInstitucion
	@ManyToOne(optional = false, fetch = FetchType.LAZY)
	@JoinColumn(name="sm_scinstitucion",referencedColumnName="sm_scinstitucion")
	private SmartInstitucion smartInstitucion;

	public SmartSede() {
	}

	public BigDecimal getSmScsedes() {
		return this.smScsedes;
	}

	public void setSmScsedes(BigDecimal smScsedes) {
		this.smScsedes = smScsedes;
	}

	public String getSmCosedes() {
		return this.smCosedes;
	}

	public void setSmCosedes(String smCosedes) {
		this.smCosedes = smCosedes;
	}

	public String getSmCousuario() {
		return this.smCousuario;
	}

	public void setSmCousuario(String smCousuario) {
		this.smCousuario = smCousuario;
	}

	public String getSmDssedes() {
		return this.smDssedes;
	}

	public void setSmDssedes(String smDssedes) {
		this.smDssedes = smDssedes;
	}

	public Date getSmFhingreso() {
		return this.smFhingreso;
	}

	public void setSmFhingreso(Date smFhingreso) {
		this.smFhingreso = smFhingreso;
	}

	public Date getSmFhmodificacion() {
		return this.smFhmodificacion;
	}

	public void setSmFhmodificacion(Date smFhmodificacion) {
		this.smFhmodificacion = smFhmodificacion;
	}

	public Date getSmFhretiro() {
		return this.smFhretiro;
	}

	public void setSmFhretiro(Date smFhretiro) {
		this.smFhretiro = smFhretiro;
	}

	public List<SmartAgenda> getSmartAgendas() {
		return this.smartAgendas;
	}

	public void setSmartAgendas(List<SmartAgenda> smartAgendas) {
		this.smartAgendas = smartAgendas;
	}

	public SmartAgenda addSmartAgenda(SmartAgenda smartAgenda) {
		getSmartAgendas().add(smartAgenda);
		smartAgenda.setSmartSede(this);

		return smartAgenda;
	}

	public SmartAgenda removeSmartAgenda(SmartAgenda smartAgenda) {
		getSmartAgendas().remove(smartAgenda);
		smartAgenda.setSmartSede(null);

		return smartAgenda;
	}

	public SmartInstitucion getSmartInstitucion() {
		return this.smartInstitucion;
	}

	public void setSmartInstitucion(SmartInstitucion smartInstitucion) {
		this.smartInstitucion = smartInstitucion;
	}

}